
#include "Image.h"

Image::Image(Image* image) {
    set_dimensions(image->get_width(), image->get_height());
    set_relative_area(image->get_relative_area());
    set_image(image->get_image());
    this->filename = image->get_filename();
}

Image::Image(int width, int height, double relative_area, IplImage* image, string filename) {
    this->set_dimensions(width, height);
    this->set_relative_area(relative_area);
    this->image = image;
    this->filename = filename;
}

Image::Image(IplImage* image, double p) {
    this->set_dimensions(image->width, image->height);
    this->set_image(image);
    this->set_relative_area(p);
}

void Image::set_image(IplImage* image) {
    this->image = image;
}

void Image::set_dimensions(int width, int height) {
    this->set_height(height);
    this->set_width(width);
}

void Image::set_relative_area(double priority) {
    this->relative_area = priority;
}

void Image::set_height(int height) {
    this->height = height;
}

void Image::set_width(int width) {
    this->width = width;
}

int Image::get_height() {
    return this->height;
}

int Image::get_width() {
    return this->width;
}

double Image::get_area() {
    return this->get_height() * this->get_width();
}

double Image::get_relative_area() {
    return this->relative_area;
}

double Image::get_aspect_ratio() {
    return ((double)(this->get_height())) / ((double)(this->get_width()));
}

IplImage* Image::get_image() {
    return image;
}
string Image::get_filename(){
    return filename;
}